package com.platform.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


/**
 * @author lipengjun
 * @email 939961241@qq.com
 * @date 2017-08-15 08:03:41
 */
public class UserVo implements Serializable {
    private static final long serialVersionUID = 1L;

    //主键
    private Long userId;
    //会员名称
    private String username;
    //会员密码
    private String password;
    //性别
    private Integer gender;
    //出生日期
    private Date birthday;
    //注册时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date register_time;
    //最后登录时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date last_login_time;
    //最后登录Ip
    private String last_login_ip;
    //会员等级
    private Integer user_level_id;
    private String user_level_name;
    //别名
    private String nickname;
    //手机号码
    private String mobile;
    //注册Ip
    private String register_ip;
    //头像
    private String avatar;
    //微信Id
    private String weixin_openid;
    ////推荐人ID
    private Long referrer_id;
    //推荐人name
    private String referrer_name;
    //推荐人图像
    private String referrer_avatar;


    private BigDecimal commission;          //佣金（累计佣金）
    private BigDecimal account;             //可提现金额
    private BigDecimal freezeAccount;       //冻结金额



    private Integer fans_all_count;
    private Integer fans_today_count;
    private Integer fans_yesterday_count;

    public String getReferrer_avatar() {
        return referrer_avatar;
    }

    public void setReferrer_avatar(String referrer_avatar) {
        this.referrer_avatar = referrer_avatar;
    }

    public String getTotal_account_format(){
        BigDecimal _account;
        BigDecimal _freeAccount;
        if (account == null){
            _account = BigDecimal.ZERO;
        } else {
            _account = account;
        }
        if (freezeAccount == null){
            _freeAccount = BigDecimal.ZERO;
        } else {
            _freeAccount = freezeAccount;
        }
        return _freeAccount.add(_account).setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString();
    }


    public String getUser_level_name() {
        return user_level_name;
    }

    public void setUser_level_name(String user_level_name) {
        this.user_level_name = user_level_name;
    }

    public BigDecimal getFreezeAccount() {
        return freezeAccount;
    }

    public String getFreezeAccount_format(){
        if (freezeAccount == null) return "";
        return freezeAccount.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString();
    }

    public void setFreezeAccount(BigDecimal freezeAccount) {
        this.freezeAccount = freezeAccount;
    }

    public BigDecimal getAccount() {
        return account;
    }

    public String getAccount_format() {
        if (account == null) return "";
        return account.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString();
    }

    public void setAccount(BigDecimal account) {
        this.account = account;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Date getRegister_time() {
        return register_time;
    }

    public void setRegister_time(Date register_time) {
        this.register_time = register_time;
    }

    public Date getLast_login_time() {
        return last_login_time;
    }

    public void setLast_login_time(Date last_login_time) {
        this.last_login_time = last_login_time;
    }

    public String getLast_login_ip() {
        return last_login_ip;
    }

    public void setLast_login_ip(String last_login_ip) {
        this.last_login_ip = last_login_ip;
    }

    public Integer getUser_level_id() {
        return user_level_id;
    }

    public void setUser_level_id(Integer user_level_id) {
        this.user_level_id = user_level_id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getRegister_ip() {
        return register_ip;
    }

    public void setRegister_ip(String register_ip) {
        this.register_ip = register_ip;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getWeixin_openid() {
        return weixin_openid;
    }

    public void setWeixin_openid(String weixin_openid) {
        this.weixin_openid = weixin_openid;
    }

    public Long getReferrer_id() {
        return referrer_id;
    }

    public void setReferrer_id(Long referrer_id) {
        this.referrer_id = referrer_id;
    }

    public BigDecimal getCommission() {
        return commission;
    }

    public String getCommission_format(){
        if (commission == null) return "";
        return commission.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString();
    }

    public void setCommission(BigDecimal commission) {
        this.commission = commission;
    }

    public String getReferrer_name() {
        return referrer_name;
    }

    public void setReferrer_name(String referrer_name) {
        this.referrer_name = referrer_name;
    }

    public Integer getFans_all_count() {
        return fans_all_count;
    }

    public void setFans_all_count(Integer fans_all_count) {
        this.fans_all_count = fans_all_count;
    }

    public Integer getFans_today_count() {
        return fans_today_count;
    }

    public void setFans_today_count(Integer fans_today_count) {
        this.fans_today_count = fans_today_count;
    }

    public Integer getFans_yesterday_count() {
        return fans_yesterday_count;
    }

    public void setFans_yesterday_count(Integer fans_yesterday_count) {
        this.fans_yesterday_count = fans_yesterday_count;
    }
}
